from enum import Enum

from views.template_page_view import FormItemDto


class FormItemsKey(Enum):

    # 配置键枚举
    STOCK_MONEY_ALL = (
        "setting.stock.money.all",
        FormItemDto("总资金量", "setting.stock.money.all", "100000", "int"),
    )

    # 风险点位可以手动配置 , 也可以自动计算
    # 达到风险点位时 ，仓位应该控制到 2 成以下
    STOCK_MONEY_UP = (
        "setting.stock.market.risk.up",
        FormItemDto("风险点位", "setting.stock.market.risk.up", "3600", "int"),
    )

    # 参与点位表示可以大胆参与，仓位可以控制在 6 成以上
    STOCK_MONEY_UP_DOWN = (
        "setting.stock.market.risk.down",
        FormItemDto("参与点位", "setting.stock.market.risk.down", "3100", "text"),
    )

    # Tushare Token
    TUSHARE_TOKEN = (
        "setting.app.tushare.token",
        FormItemDto("Tushare Token", "setting.app.tushare.token", "", "text"),
    )

    TUSHARE_INIT_DAY = (
        "setting.app.tushare.init.day",
        FormItemDto("股票初始化天数", "etting.app.tushare.init.day", "", "int"),
    )

    def __init__(self, key: str, form_item: FormItemDto):
        self.key = key
        self.form_item = form_item

    def __str__(self):
        return self.key
